<script setup lang="ts">
import { useStorage, useSessionStorage } from '@vueuse/core'
const state = useStorage('vue-use-local-storage', {
  name: 'Banana',
  color: 'Yellow',
  size: 'Medium',
}, sessionStorage)
const text = state.value;
const state2 = useSessionStorage('vue-use-local-storage2');
const text2 = state2.value;
</script>

<template>
  <div>
    <input v-model="state.name" type="text">
    <input v-model="state.color" type="text">
    <input v-model="state.size" type="text">

    <pre lang="json">{{ text }}</pre>
    取vue示例的值
    <pre lang="json">{{ text2 }}</pre>
  </div>
</template>